<link rel="stylesheet" href="../addons/jy_merch/css/mobile.css?v=6">
<div ng-if="pagedata.op=='list'" class='fui-page fui-page-current'>
    <div class="fui-header fui-header-success">
        <div class="fui-header-left">
            <a class="back" ng-click="goback();"></a>
        </div>
        <div class="title">订单管理</div>
    </div>
    <!-- 顶部tab -->
    <div id="tab" class="fui-tab fui-tab-success fixed">
			<a ng-class="{'active':pagedata.params.status=='all'}" ng-click="pagedata.params.status = 'all';tool.get_list('jy_merch/manage.refund/list/',true)">全部</a>
            <a ng-class="{'active':pagedata.params.status==0}" ng-click="pagedata.params.status = 0;tool.get_list('jy_merch/manage.refund/list/',true)" >待审核</a>
            <a ng-class="{'active':pagedata.params.status==1}" ng-click="pagedata.params.status = 1;tool.get_list('jy_merch/manage.refund/list/',true)">审核通过</a>
            <a ng-class="{'active':pagedata.params.status==2}" ng-click="pagedata.params.status = 2;tool.get_list('jy_merch/manage.refund/list/',true)">已发货</a>
            <a ng-class="{'active':pagedata.params.status==4}" ng-click="pagedata.params.status = 4;tool.get_list('jy_merch/manage.refund/list/',true)">已退款</a>
    </div>
    <div class='fui-content' style="margin-top:4.8rem">
		<div class="searchbar" style='margin:0.3rem;padding:0'>
                    <div class="search-input">
                        <i id="searchsub" class="icon icon-search" ng-click="tool.get_list('jy_merch/manage.refund/list/',true)"></i>
                        <input type="search" id='keywords' ng-model="pagedata.params.keyword" placeholder="输入订单号..." style="border: 1px solid #f7f7f7;">
                    </div>
        </div>
		<div class="jy-content">
        <!-- 订单列表 -->
        <div ng-repeat="item in pagedata.list" class="fui-list-group radius" style="margin-top:0.2rem">
            <a class="fui-list order-list title-b"  data-nocache="true">
                <div class="fui-list-media">
                    <span ng-if='item.paytype' class="fui-label fui-label-danger round">{{item.paytype}}</span>
					<span ng-if='!item.paytype' class="fui-label fui-label-danger round">未付款</span>
                </div>
                <div class="fui-list-inner">
                    <div class="row">
                        <div class="row-text" style="font-size: 0.7rem; color: #666">{{item.ordersn}}</div>
                    </div>
                    <div class="row gary">
                        <div class="row-text">{{item.createtime}}</div>
                    </div>
                </div>
                <div class="angle"></div>
            </a>
            
                <div ng-repeat="g in item.goods" class="fui-list goods-list">
                    <div class="fui-list-media">
                        <img class="round" ng-src="{{tomedia(g.image)}}"  />
                    </div>
                    <div class="fui-list-inner">
                        <div class="title">{{g.title}}</div>
                        <div class="text" style="color:#f60;font-size:0.50rem">{{g.selespename || '无规格'}} x {{g.total || 1}}</div>
                    </div>
                    <div class="fui-list-angle auto">￥<span class="marketprice">{{g.price}}<br> x{{g.total}}</span></div>
                </div>
           
            <div class="fui-list log-list noclick">
                <div class="fui-list-inner">
                    <div class="row log-row order">
                        <div class="row-text">订单状态</div>
                        <div class="row-remark"><span class="text-danger">{{item.statustitle}}</span></div>
                    </div>
                    <div class="row log-row order">
                        <div class="row-text">买家昵称</div>
                        <div class="row-remark">{{item.member.nickname}}</div>
                    </div>
                    <div class="row log-row order">
                        <div class="row-text">配送方式</div>
                        <div class="row-remark"><span class="text-success">{{item.sendtypetitle}}</span></div>
                    </div>
                  
					 <div ng-if="item.msgtypes.length>0" class="row log-row order">
                            <div class="row-text">退款原因</div>
                            <div class="row-remark"><span ng-repeat="mv in item.msgtypes" class="label label-info">{{mv}}</span></div>
                    </div>
					 <div ng-if="item.content" class="row log-row order">
                            <div class="row-text">退款备注</div>
                            <div class="row-remark">{{item.content}}</div>
                    </div>
					<div ng-if="item.selfnumber" class="row log-row order">
                        <div class="row-text">取货号</div>
                        <div class="row-remark"><span class="text-success bold" style="font-size:0.8rem;">#{{item.selfnumber2}}</span></div>
                    </div>     
                </div>
            </div>
            <div class="fui-list-group-title text-right">
                <small class="status">共<span class="text-success">{{item.goodscount}}</span>个商品 实付:<span class="text-success">￥{{item.price}}</span> </small>
            </div>
            <div class="fui-list-group-title text-right big">
				<a ng-if="item.status==0" ng-click="access_json('/manage.refund/check/id='+item.id)" class="btn btn-success btn-sm order-btn">审核退款</a> 
				<a ng-if="item.status==2" ng-click="post({},'/manage.refund/receive/','id='+item.id,'','请确定，已经线下收到客户的退货商品！')" class="btn btn-success btn-sm order-btn">确认收货</a> 
				<a ng-if="item.status==5" ng-click="pagedata.nowreason=item.reason;pagedata.showlook=true" class="btn btn-success btn-sm order-btn">查看拒绝理由</a> 
                <a class="btn btn-default btn-sm" ng-click="access_json('/manage.order_detail//id='+item.orderid)">查看详情</a>
            </div>
        </div>
		</div>
        <div ng-if="pagedata.list==''" class="fui-title center" id="content-empty">没有数据</div>
    </div>
    <div class="head-menu-mask"></div>
</div>
<div ng-if="pagedata.op=='check'" class='fui-page fui-page-current'>
    <div class="fui-header fui-header-success">
        <div class="fui-header-left">        
        </div>
        <div class="title">退款申请审核</div>
        <div class="fui-header-right"></div>
    </div>
    <div class='fui-content' style="margin-top:2.5rem">
		<div class='jy-content'>
        <div class="fui-cell-group">
            <div class="fui-cell ">
                <div class="fui-cell-label">订单原状态</div>
				<div class="fui-cell-info"></div>
                <div class="fui-cell-remark noremark">
				{{pagedata.item.orderstatustitle}}
                </div>
            </div>
			<div class="fui-cell">
                <div class="fui-cell-label">退款类型</div>
				<div class="fui-cell-info"></div>
                <div class="fui-cell-remark noremark">
				{{pagedata.item.paytype}}
                </div>
            </div>
			<div class="fui-cell">
				<div class="fui-cell-label">审核</div>
				<div class="fui-cell-text" ng-repeat="(key,value) in pagedata.status" ng-click="pagedata.item.status=key" >
					<input type="radio" class="fui fui-radio fui-radio-danger verify-radio" ng-checked='pagedata.item.status==key' name="status" value="{{key}}"> {{value}}
				</div>
			</div>
			<div class="fui-cell">
				<div class="fui-cell-label">审核理由</div>
				<div class="fui-cell-info" >
					<textarea rows="3" placeholder="请填写审核理由！" ng-model="pagedata.item.reason"></textarea>
				</div>
			</div>
			<div class="fui-cell">
				<div class="fui-cell-label">卖家上传的图片</div>
				<div class="fui-cell-info">
						<ul class="fui-images fui-images" id="images" ng-click="previewImage('',pagedata.item.images);">
							<div ng-repeat="image in pagedata.item.images track by $index">
							<li style="background-image:url({{tomedia(image)}})" class="image">
							<span class="image-remove" ng-click="pagedata.item.images.splice($index,1)"><i class="icon icon-close"></i></span>
							</li>
							</div>
						</ul>
				</div>
			</div>
			<div class="fui-cell">
				<div class="fui-cell-label">卖家退款说明</div>
				<div class="fui-cell-info" >
					{{pagedata.item.content}}
				</div>
			</div>
        </div>
			<div class="weui_btn_area">
			 <a class="weui_btn weui_btn_primary" href="javascript:" ng-click="post(pagedata.item,'/manage.refund/check/')">确定提交</a>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.showlook" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showlook=false"></i>
			<div class="content-images" style="padding:0.5rem;height:18rem; overflow-y:scroll;">
					<div class="title bold" style="font-size:0.8rem">退款审核理由</div>
					<div class="text" style="padding-top:0.5rem;font-size:0.7rem">
						{{pagedata.nowreason}}
					</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
scope.tool.get_list('jy_merch/manage.refund/list/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_merch/manage.refund/list/');
}
</script>
